package com.wanlian.router.utils;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.wanlian.router.net.netty2.msg.BaseMsg;
import com.wanlian.router.net.netty2.msg.FileBaseMsg;

/**
 * Created by Hyu on 2018/10/28.
 * Email: fvaryu@163.com
 */
public class JsonStringUtil {

    public static String writeValueAsString(Object o) {
        return new Gson().toJson(o);
    }

//    public static BaseMsg readValue(String content, Type typeToken) {
//        return new Gson().fromJson(content, typeToken.getType());
//    }

//    public static BaseMsg readValue(String content, Class<FileBaseMsg> baseMsgClass) {
//        return new Gson().fromJson(content, baseMsgClass);
//    }
}
